<?php

use think\migration\Migrator;
use think\migration\db\Column;

class MeetWishUsers extends Migrator
{
    public function up()
    {
        $table = $this->table('meet_wish_users');
        $table->addColumn('wish_id', 'integer', array('comment' => '心愿id'))
              ->addColumn('meet_user_id', 'integer', array('comment' => '满足心愿的房车所有者id'))
              ->addColumn('caravan_id', 'integer', array('comment' => '满足心愿的房车id'))
              ->addColumn('status', 'integer', array('default' => 0, 'limit' => 1, 'comment' => '状态'))
              ->addColumn('created_at', 'timestamp', array('default' => 'CURRENT_TIMESTAMP'))
              ->addColumn('updated_at', 'timestamp', array('null' => true))
              ->save();   
    }
    public function down()
    {
        $this->dropTable('meet_wish_users');
    }
}
